package com.report.dto.response;

import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.SearchBean;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author summer
 * @date 2024-06-27 16:48
 */
@Data
@SearchBean(tables = " research_insight i LEFT JOIN `research_report` r ON i.report_id=r.id",autoMapTo = "i",orderBy = "i.create_time DESC")
public class InsightRes implements Serializable {

    @DbField("i.id")
    private Integer id;

    @DbField("i.name")
    private String name;

    @DbField("CASE WHEN i.browse_num=null THEN 0 ELSE i.browse_num END ")
    private Integer browseNum;

    @DbField("i.context")
    private String context;

    @DbField("i.report_id")
    private Integer reportId;

    @DbField("r.name")
    private String reportName;

    @DbField("i.image")
    private String image;

    @DbField("i.create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createTime;

    @DbField("i.auth")
    private String auth;

    @DbField("i.deleted")
    private Integer deleted;

    @DbField("i.hotspot")
    private Integer hotspot;

    @DbField(" CASE WHEN i.hotspot=0 THEN '否' ELSE '是' END")
    private String hotspotName;

}
